gsk_profiler_counter_add (profiler, counter_id, 1);
}
+void
+gsk_profiler_counter_set (GskProfiler *profiler,
+ GQuark counter_id,
+ gint64 value)
+{
+ NamedCounter *counter;
+
+ g_return_if_fail (GSK_IS_PROFILER (profiler));
+
+ counter = gsk_profiler_get_counter (profiler, counter_id);
+ if (counter == NULL)
+ {
+ g_critical ("No counter '%s' (id:%d) found; did you forget to call gsk_profiler_add_counter()?",
+ g_quark_to_string (counter_id), counter_id);
+ return;
+ }
+
+ counter->value = value;
+}
+
void
gsk_profiler_counter_add (GskProfiler *profiler,
GQuark counter_id,
counter = gsk_profiler_get_counter (profiler, counter_id);
if (counter == NULL)
- return;
+ {
+ g_critical ("No counter '%s' (id:%d) found; did you forget to call gsk_profiler_add_counter()?",
+ g_quark_to_string (counter_id), counter_id);
+ return;
+ }
counter->value += increment;
}
void gsk_profiler_counter_add (GskProfiler *profiler,
GQuark counter_id,
gint64 increment);
+void gsk_profiler_counter_set (GskProfiler *profiler,
+ GQuark counter_id,
+ gint64 value);
void gsk_profiler_timer_begin (GskProfiler *profiler,
GQuark timer_id);
gint64 gsk_profiler_timer_end (GskProfiler *profiler,